<?php
	if ($mod=="group"){
		if ($act == 'main_add') {
			$res = $forumclass->forum_add($name);
			if ($res != 1) $err->AddError(17);
		} elseif ($act == 'del_mas') {
			$del_mas = array();
			if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
			elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
			if (count($del_mas) > 0){
				$forumclass->forum_del($del_mas);
			}
		} elseif ($act == 'mod') {
			if (isset($_POST["name"]) && isset($_POST["group_id"]))
				$forumclass->forum_mod($_POST["group_id"], $_POST["name"]);
		}
	} elseif ($mod=="subject"){
		if ($act == 'up') {
			$group_id = NULL; $subject_id = NULL;
			if (!isset($_GET['group_id'])) $group_id=NULL; else $group_id=$_GET['group_id'];
			if ($group_id==NULL) if (!isset($_POST['group_id'])) $group_id=NULL; else $group_id=$_POST['group_id'];
			if (!isset($_GET['subject_id'])) $subject_id=NULL; else $subject_id=$_GET['subject_id'];
			if ($subject_id==NULL) if (!isset($_POST['subject_id'])) $subject_id=NULL; else $subject_id=$_POST['subject_id'];
			if (($group_id!=NULL) && ($subject_id!=NULL)) $forumclass->subject_pos($group_id, $subject_id, "up");				
		} elseif ($act == 'down'){
			$group_id = NULL; $subject_id = NULL;
			if (!isset($_GET['group_id'])) $group_id=NULL; else $group_id=$_GET['group_id'];
			if ($group_id==NULL) if (!isset($_POST['group_id'])) $group_id=NULL; else $group_id=$_POST['group_id'];
			if (!isset($_GET['subject_id'])) $subject_id=NULL; else $subject_id=$_GET['subject_id'];
			if ($subject_id==NULL) if (!isset($_POST['subject_id'])) $subject_id=NULL; else $subject_id=$_POST['subject_id'];
			if (($group_id!=NULL) && ($subject_id!=NULL)) $forumclass->subject_pos($group_id, $subject_id, "down");				
		} elseif ($act == 'del_mas'){
			$del_mas = array();
			if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
			elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
			if (count($del_mas) > 0){
				$forumclass->subject_del($del_mas);
			}
		}
	} elseif ($mod=="post"){
		if ($act == 'del_mas'){
			$del_mas = array();
			if (isset($_GET["ids"])) $del_mas=$_GET["ids"];
			elseif (isset($_POST["ids"])) $del_mas=$_POST["ids"];
			if (count($del_mas) > 0){
				$forumclass->post_del($parent, $del_mas);
			}
		}
	} 
?>